home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10279 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: solon.com!not-for-mail
  2. From: stanr@tiac.net (Stan Ryckman)
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
  4. Subject: Re: C coding problem
  5. Date: 16 Mar 1996 09:23:01 -0600
  6. Organization: Amber & Sneakers Fan Club
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4iemcl$a05@solutions.solon.com>
  10. References: <4ianbf$h86@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12.  
  13. In article <4ianbf$h86@solutions.solon.com>,
  14. Stephen Proctor <proctor@corp.hp.com> wrote:
  15.  
  16. [snip]
  17.  
  18. >for (ii=1; ii<argc; ii++) {
  19. >/* skip lines */
  20. >/* The next line is the offending line */
  21. >   if (*argv[ii] == '-') option_val = read_options;
  22.  
  23. Ugh!  If I were going to mix operators that way I'd use parens.
  24.  
  25. Why not just write
  26.     if (argv[ii][0] == '-') ...
  27. and then you won't have to worry what "*argv[ii]" is?
  28.  
  29. Cheers,
  30. Stan.
  31. --
  32. Stan Ryckman  (stanr@tiac.net)
  33.   (Apologies for non-responses or late responses to some posts;
  34.   .newsrc was trashed and I'm trying to get it back to where it was.)
  35.